package com.benz.order.util.multithread;

public class ThreadTaskSyn implements Runnable {
    private int tickets=10;
    @Override
    public void run() {
        while (tickets > 0) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(Thread.currentThread().getName() + "卖出的票：" + tickets--);
        }
    }
}
